package com.airticketbooking.mapper;

import com.airticketbooking.po.Point;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @author Mr.J
 * @version 1.0.0
 * @date 2024/11/13
 * @desc
 */
@Mapper
public interface PointMapper {


	@Select("SELECT * FROM airticketbooking.point WHERE member_id = #{memberId}")
	Point getPointByMemberId(Integer memberId);


	@Update("UPDATE airticketbooking.point SET total_points = #{totalPoints} WHERE point_id = #{pointId}")
	void ModifyPoint(Integer pointId, Integer totalPoints);

	@Insert("INSERT INTO airticketbooking.point (member_id, total_points) VALUES (#{memberId}, #{totalPoints})")
	void add(Point point);
}
